<?
// pr($params);

?>


<style>

.mailform_container {
	text-align:center;
	background: #eee; 
	border:#ccc 1px solid;
	border-bottom-color:#999;
	}

.mailform_container FORM {margin:0; padding:0;}

.mailform_header {
	margin:0;
	padding:5px 0;
	text-align: center; 
	font:bold 16px 	Arial;
	color: #333;  
	background: #d8d8d8;   
	border:#f5f5f5 1px solid; 
	border-bottom: #999 1px solid;
}
.mailform_info  {}
.mailform_info {color:#777;}
.mailform_error {}	
.mailform_ок {}
.mailform_container FORM {}
.mailform_body {
	padding: 6px 10px;
	text-align: left;
	font: 13px arial,tahoma, verdana;
	color: #003300; 
}
.mailform_body TD {}
.mailform_row TD {}

.mailform_label {
	padding:0px 10px 0 0px;
	}
.mailform_field {
	padding:1px 10px 12px 0px;
	}
.mailform_field INPUT,
.mailform_field TEXTAREA  {
	width: 100%; height: 20px;
	border: 1px solid #ccc;
	background: #fff; 
	color: #000; 
	font: 14px arial; 
	
}
.mailform_field TEXTAREA {
	height: 130px;
	overflow: auto;
	width: 98%;
}

.mailform_td1 {padding:0 15px 0 0px;}
.mailform_td2 .mailform_field {
	padding:1px 1px 12px 0px;
} 


.mailform_submits {
	padding: 5px 0px 15px;
	text-align: left
}

.mailform_submits INPUT {
	font: 12px tahoma; 
	cursor: pointer; 
	width: 130px; height: 25px;
}
.mailform_error { 
	border:1px solid #fcc;
	
	background: #f8f8f8;
	color:red;
	margin:5px 0; padding:5px;
	text-align:center;
 }
</style>


<?=Mailform::start()?>
<?if($error){?><div class=mailform_error><?=$error?><script>alert("<?=$params['error_alert']?>")</script></div><?}?>

<DIV class=mailform_container>



<?if($header){?><div class=mailform_header><?=$header?></div><?}?>



<DIV class=mailform_body>
	
	<TABLE width="100%" ><TBODY>
	<TR>
	<TD vAlign=top class=mailform_td1 >

<?  // выводим первую колонку
$fields2=array();
// pr($fields);
foreach ($fields AS $field) 
{ 
	// в левой колонке выводим только однострочные поля
	if ($field->type=='textarea') {$fields2[]=$field; continue;}

	?>
	<DIV class=mailform_label ><?=$field->label?> </DIV>
	<DIV class=mailform_field ><?=$field->field?> </DIV>

<?}?>



<? // выводим вторую колонку, если есть многострочные поля 
if($fields2)
{?>
	<TD vAlign=top width=70% class=mailform_td2>

	<?
	foreach ($fields2 AS $field) 
	{ 
		?>
		<DIV class=mailform_label ><?=$field->label?> </DIV>
		<DIV class=mailform_field ><?=$field->field?> </DIV>


	<?} //end foreach?>
<?} //end if?>


<TR>
<?if($fields2) echo "<TD >";?>

<TD>


<DIV class=mailform_info >
Перед отправкой сообщения рекомендуется скопировать его в буфер.
</DIV>



<DIV class=mailform_submits >
	<?=Mailform::submits()?>
</DIV>

</TR></TBODY></TABLE></DIV>



<?=Mailform::end()?>
</DIV>




